package cz.acies.face;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;

public class Widget implements Serializable 
{
	private static final long serialVersionUID = 1936015460072307911L;

	protected String id;
	protected Widget parent;
	protected Map<String, Object> options;
	
	public Widget() {
		this(null);
	}
	
	public Widget(Widget parent) {
		this(null, parent);
	}

	public Widget(String id, Widget parent) {
		this.parent = parent;
		this.options = new LinkedHashMap<String, Object>(); 
	}

	// -----  -----------------------------------------------------------------
	
	public String toHtml() {
		return "";
	}

	public String asAxDS() {
		return null;
	}
	
	// -----  -----------------------------------------------------------------

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Widget getParent() {
		return parent;
	}

	public void setParent(Widget parent) {
		this.parent = parent;
	}

	// -----  -----------------------------------------------------------------
	
	public Map<String, Object> getOptions() {
		return options;
	}

	public void setOptions(Map<String, Object> options) {
		this.options = options;
	}
	
	public void addOption(String key, Object value) {
		this.options.put(key, value);
	}
	
	public Object  getOption(String key) {
		return this.options.get(key);
	}
}
